home *** CD-ROM | disk | FTP | other *** search
/ The CICA Windows Explosion! / The CICA Windows Explosion! - Disc 2.iso / winsock / ircii2-6.zip / SRC\IRCII-2.6\BSDINSTA < prev    next >
Text File  |  1993-11-07  |  1KB  |  91 lines

  1. #! /bin/sh
  2. #
  3. #    @(#)install.sh    4.5    (Berkeley)    10/12/83
  4. #
  5. cmd=/bin/mv
  6. strip=""
  7. chmod="/bin/chmod 755"
  8. chown=""
  9. chgrp=""
  10. while true ; do
  11.     case $1 in
  12.         -s )    strip="/bin/strip"
  13.             shift
  14.             ;;
  15.         -c )    cmd="/bin/cp"
  16.             shift
  17.             ;;
  18.         -m )    chmod="/bin/chmod $2"
  19.             shift
  20.             shift
  21.             ;;
  22.         -o )    chown="/etc/chown -f $2"
  23.             shift
  24.             shift
  25.             ;;
  26.         -g )    chgrp="/bin/chgrp -f $2"
  27.             shift
  28.             shift
  29.             ;;
  30.         -d )    cmd="/bin/mkdir"
  31.             shift
  32.             ;;
  33.         * )    break
  34.             ;;
  35.     esac
  36. done
  37.  
  38. if test ! ${2-""}; then
  39.     echo "install: no destination specified"
  40.     exit 1
  41. fi
  42. if test ${3-""}; then
  43.     echo "install: too many files specified -> $*"
  44.     exit 1
  45. fi
  46. if test $1 = $2 -o $2 = .; then
  47.     echo "install: can't move $1 onto itself"
  48.     exit 1
  49. fi
  50. case $cmd in
  51. /bin/mkdir )
  52.     file=$2/$1
  53.     ;;
  54. * )
  55.     if test '!' -f $1; then
  56.         echo "install: can't open $1"
  57.         exit 1
  58.     fi
  59.     if test -d $2; then
  60.         file=$2/$1
  61.     else
  62.         file=$2
  63.     fi
  64.     /bin/rm -f $file
  65.     ;;
  66. esac
  67.  
  68. case $cmd in
  69. /bin/mkdir )
  70.     if test ! -d "$file"; then
  71.         $cmd $file
  72.     fi
  73.     ;;
  74. * )
  75.     $cmd $1 $file
  76.     if test -n "$strip"; then
  77.         $strip $file
  78.     fi
  79.     ;;
  80. esac
  81.  
  82. if test -n "$chown"; then
  83.     $chown $file
  84. fi
  85. if test -n "$chgrp"; then
  86.     $chgrp $file
  87. fi
  88. $chmod $file
  89.  
  90. exit 0
  91.